package domein;

import java.util.Observable;

/**
 * Informs GUI of connection state.
 *
 * @author Colin Bundervoet
 * @author Jeroen Pattyn
 */
public class StateObservable extends Observable
{
    private boolean state;

    /**
     * Default constructor setting current state to false.
     */
    StateObservable() {
        state = false;
    }

    /**
     * notifies observers of changed connection state.
     *
     * @param state boolean of current state.
     */
    public void updateState(boolean state) {
        this.state = state;
        setChanged();
        notifyObservers();
    }

    /**
     * Returns the current state from this object.
     *
     * @return boolean state of this object.
     */
    public boolean getState() {
        return state;
    }
}
